import requestService from "../service/request";

const Api = {
  H5Login: "/user/wxLogin",
  code: "/register/getOpenId",
  register: "/register/userRegister",
  yzm: "/register/sendSmsCode",
  login: "/login",
  user: "/userDetail/getUserInfo",
  dx: "/reset/sendResetSms",
  reset: "/reset/reset",
  apiCommit: "/user/applyForApi",
};
//重构 以后的 H5-供应端获取OpenId接口

export function EmitCodeByH5(data) {
  return requestService(Api.code, {
    type: "post",
    data,
    // paramsFormdata: "application/x-www-form-urlencoded",
  });
}

//重构 以后的H5-供应端 注册
export function userRegister(data) {
  return requestService(Api.register, {
    type: "post",
    data,
  });
}

//重构 以后的H5-获取注册验证码
export function getYzm(data) {
  return requestService(Api.yzm, {
    type: "post",
    data,
  });
}

//重构 H5的 登录接口
export function Login(data) {
  return requestService(Api.login, {
    type: "post",
    data,
  });
}

//获取用户信息
export function userInfo(data) {
  return requestService(Api.user, {
    type: "get",
    data,
    paramsFormdata: "application/x-www-form-urlencoded",
  });
}

//H5 接入web端的账号密码登录
export function FormdataLogin(data) {
  return requestService(Api.login, {
    type: "post",
    data,
  });
}

//重置密码

export function ResetYzm(data) {
  return requestService(Api.dx, {
    type: "post",
    data,
  });
}
//重置密码功能
export function ResetPass(data) {
  return requestService(Api.reset, {
    type: "post",
    data,
  });
}
//Api 申请
export function apiCommit(data) {
  return requestService(Api.apiCommit, {
    type: "post",
    data,
  });
}